extends "../cTDW/cTDW.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "骑士"
	lv = 2
	attCoe.atkRan = 2
	attCoe.atk = 40 / 8.5 * 2 / 2
	attCoe.maxHp = 800 / 112.5 / 2
	attAdd.penL = 0.1
	attAdd.spd -= 0.07
	addSkillTxt("长枪穿透：普攻攻击当前敌人及身后1个敌人;护甲穿透+10%;攻击距离+1")

func _onAtkChara(atkinfo:AtkInfo):
	._onAtkChara(atkinfo)
	if atkinfo.atkType == Chara.AtkType.NORMAL && atkinfo.hitCha == aiCha:
		var flag = 1
		var st = cell.x
		if aiCha.cell.x > st:st = min(9,aiCha.cell.x + 1)
		elif aiCha.cell.x < st:
			st = max(0,aiCha.cell.x - 1)
		else:
			flag = 0
			st = cell.y
			if aiCha.cell.y > st:st = min(5,st + 1)
			else:
				st = max(0,st - 1)
		var chas = getAllChas(1)
		if flag :
			for i in chas:
				if i.cell.y == aiCha.cell.y && i.cell.x == st:
					hurtChara(i,att.atk,Chara.HurtType.PHY,Chara.AtkType.NORMAL)
		else:
			for i in chas:
				if i.cell.x == aiCha.cell.x && i.cell.y == st:
					hurtChara(i,att.atk,Chara.HurtType.PHY,Chara.AtkType.NORMAL)